package com.content.Controller.drama;

import com.common.Entity.Result;
import com.content.Entity.drama.Audio;
import com.content.Mapper.drama.AudioMapper;
import com.content.Service.drama.AudioService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/drama/audio")
public class AudioController {
    @Autowired
    private AudioService audioService;
    @PostMapping("/addAudio")
    public Result  addAudio(@RequestBody  Audio audio){
        audioService.addAudio(audio);
        return Result.success();
    }

    @PutMapping("/updateAudio")
    public Result updateAudio(@RequestBody Audio audio){
        audioService.updateAudio(audio);
        return Result.success();
    }

    @DeleteMapping("/deleteAudio/{audioId}")
    public Result deleteAudio(@PathVariable String audioId){
        audioService.deleteAudio(audioId);
        return Result.success();
    }


}
